<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
	<ul class="nav nav-tabs">
		<li><a href="{:url('Goods/index')}">商品列表</a></li>
		<li class="active"><a href="{:url('Goods/add')}">添加商品</a></li>
	</ul>
	<form action="{:url('Goods/addPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
		<div class="form-group">
			<label class="col-sm-2 control-label">标题</label>
			<div class="col-md-6 col-sm-10">
				<input type="text" class="form-control" name="title">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">运费</label>
			<div class="col-md-6 col-sm-10">
				<input type="text" class="form-control" name="price">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">分类ID</label>
			<div class="col-md-6 col-sm-10">
				<input type="text" class="form-control" name="gid">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">运营类型</label>
			<div class="col-md-6 col-sm-10">
				<select name="type" class="form-control">
					<option value="0">自营</option>
					<option value="1">旗舰店</option>
				</select>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">商品状态</label>
			<div class="col-md-6 col-sm-10">
				<select name="switch" class="form-control">
					<option value="0">缺货</option>
					<option value="1">上架</option>
					<option value="2">下架</option>
				</select>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">封面图<span class="form-required">*</span></label>
			<div class="col-md-6 col-sm-10">
				<input id="photo-1" type="hidden" name="image">
				<input id="photo-1-name" class="form-control" type="text" name="" title="图片名称" disabled readonly>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label"></label>
			<div class="col-md-6 col-sm-10">
				<img id="photo-1-preview" width="40px">
				<a href="javascript:uploadOneImage('图片上传','#photo-1');" class="btn btn-primary">上传</a>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">图集</label>
			<div class="col-md-6 col-sm-10">
				<div id="imagesContainer"></div>
				<div class="margin-top-10">
					<a class="btn btn-default" href="javascript:uploadMultiImage('图片上传','#imagesContainer','photos-item-wrapper');">选择图片</a>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-offset-2 col-sm-10">
				<button type="submit" class="btn btn-primary js-ajax-submit">提交</button>
			</div>
		</div>
	</form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script type="text/html" id="photos-item-wrapper">
	<li id="savedimage{id}">
		<input id="photo-{id}" type="hidden" name="photos_url[]" value="{filepath}">
		<input id="photo-{id}-name" type="text"  value="{name}" style="width: 160px;" title="图片名称">
		<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;" onclick="parent.image_preview_dialog(this.src);">
		<a href="javascript:upload_one_image('图片上传','#photo-{id}');">替换</a>
		<a href="javascript:(function(){$('#savedimage{id}').remove();})();">移除</a>
	</li>
</script>
</body>
</html>
